import { NextResponse } from "next/server"
import type { NextRequest } from "next/server"

export function middleware(request: NextRequest) {
  const token = request.cookies.get("token")?.value

  // if (!token) {
  //   const authUrl = new URL("/auth", request.url)
  //   authUrl.searchParams.set("from", request.nextUrl.pathname)
  //   return NextResponse.redirect(authUrl)
  // }

  return NextResponse.next()
}

// 配置需要保护的路径
export const config = {
  matcher: ["/apps/:path*"]
}
